package com.uchengwang.ui.base_ui.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.uchengwang.R;
import com.uchengwang.functions.http.config.BaseConfig;
import com.uchengwang.ui.utils.LayoutAddViewUtils;
import com.uchengwang.ui.utils.UCommonUtil;

import static com.uchengwang.R.id.fast_content;

/**
 * Created by U城网 on 2017/7/15.
 * 问题反馈模块
 */

public class FeedbackItemActivity extends BaseWithTitleActivity{
    private LinearLayout content;
    private String[] titles = null;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_fast_release);
        setTitle("反馈建议");

        initView();

    }

    private void initView() {
        content = (LinearLayout) findViewById(fast_content);

        if (UCommonUtil.getUtil().isUni()){
            titles = new String[]{"产品bug", "校吧话题", "线下活动", "商务合作", "其他建议"};
        }else {
            titles = new String[]{"注册登录", "U城", "U社", "UU", "我的", "其他"};
        }

        initData();
    }

    private void initData() {
        new LayoutAddViewUtils(this).addView(content, titles).setOnViewItemListener(new LayoutAddViewUtils.OnViewItemListener() {
            @Override
            public void onViewItem(View view, int position) {
                Intent intent = new Intent(FeedbackItemActivity.this, FeedbackDetailActivity.class);
                intent.putExtra(BaseConfig.TITLE, titles[position]);
                startActivity(intent);
                FeedbackItemActivity.this.finish();

            }
        });

    }
}
